package cn.hdu.liang.annotations;

import java.util.List;

public class PasswordUtils {
    @UseCase(id = 47, description = "密码必须包含数字")
    public boolean validatePassword(String password) {
        return (password.matches("\\w*\\d\\w*"));
    }

    @UseCase(id = 48)
    public String encryptPassword(String password) {
        return new StringBuilder(password).reverse().toString();
    }

    @UseCase(id = 49, description = "新密码不等于旧密码")
    public boolean checkForNewPassword(List<String> prePassword, String passowrd) {
        return !prePassword.contains(passowrd);
    }
}
